package dao;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;

public class BlogDaoImpl extends BaseDao implements BlogDao{


    public BlogDaoImpl(Connection conn) {//引用传递
        super(conn);
    }

    @Override
    public int getBlogCount() throws SQLException {
        String sql ="SELECT count(id) c FROM blog";
        ResultSet rs= super.executeQuery(sql);
        if (rs.next()){
            return rs.getInt("c");
        }
        return 0;
    }
}
